package com.linkstec.aspect;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AroundAspect {

	private static final Logger logger = LogManager.getLogger();
	/**
	 * 织入UserController中ctx方法
	 */
	@Around(value = "execution(* com.linkstec.controller.UserController.ctx(..))")
	public void addAroundHandlePageStatus(ProceedingJoinPoint joinPoint) {
		logger.info("先执行我");
		try {
			joinPoint.proceed();
		} catch (Throwable e) {
			logger.error(e);
		}
	}
}